<div class="uk-layui-form">
    <form class="layui-form uk-form" action="/admin/callcenter/extention/batupdate.html" data-toggle="ajax-form" data-inner="#callCenterContent">
    	<input type="hidden" name="hostid" value="${pbxHost.id!''}">
        <div class="layui-form-item">
            <label class="layui-form-label" style="padding-top:7px;">分机：</label>
            <div class="layui-input-inline" style="width:700px;">
                <#if extentionList??>
                <#list extentionList as extention>
                <input type="checkbox" name="ids" title="${extention.extention}" value="${extention.id!''}" lay-skin="primary" checked>
                </#list>
                </#if>
            </div>
        </div>
		<#if !ismy?? || (ismy?? && !ismy)>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">分机密码：</label>
	            <div class="layui-input-inline">
	                <input type="password" id="password" name="password" placeholder="请输入分机密码" autocomplete="off" class="layui-input">
	            </div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">分机类型：</label>
	            <div class="layui-input-inline">
	            	<select id="extype" name="extype">
						<option value="">请选择...</option>
						<option value="line" <#if extention.extype?? && extention.extype == "line">selected="selected"</#if>>直线</option>
						<option value="ivr" <#if extention.extype?? && extention.extype == "ivr">selected="selected"</#if>>IVR</option>
						<option value="business" <#if extention.extype?? && extention.extype == "business">selected="selected"</#if>>业务</option>
						<option value="skill" <#if extention.extype?? && extention.extype == "skill">selected="selected"</#if>>技能组</option>
						<option value="conference" <#if extention.extype?? && extention.extype == "conference">selected="selected"</#if>>会议</option>
						<option value="quene" <#if extention.extype?? && extention.extype == "quene">selected="selected"</#if>>队列</option>
					</select>    
	            </div>
			</div>
		</div>
    	</#if>
        
        <div class="layui-form-item">
        	<div class="layui-inline">
	            <label class="layui-form-label">是否允许外呼：</label>
	            <div class="layui-input-inline">
	            	<input type="checkbox" name="callout" lay-skin="switch" lay-text="开启|关闭" <#if extention.callout>checked="checked"</#if>>    
	            </div>
	        </div>
	        <div class="layui-inline">
	            <label class="layui-form-label">绑定SIP网关：</label>
	            <div class="layui-input-inline">
	            	<select id="siptrunk" name="siptrunk">
						<option value="">请选择...</option>
						<#if sipTrunkListList??>
						<#list sipTrunkListList as sipTrunkInfo>
						<option value="${sipTrunkInfo.id!''}" <#if extention.siptrunk?? && extention.siptrunk == sipTrunkInfo.id>selected="selected"</#if>>${sipTrunkInfo.name!''}</option>
						</#list>
						</#if>
					</select>    
	            </div>
	        </div>
        </div>
        <div class="layui-form-item">
        	<div class="layui-inline">
	            <label class="layui-form-label">禁用ICE：</label>
	            <div class="layui-input-inline">
	                <input type="checkbox" name="record" lay-skin="switch" lay-text="开启|关闭" <#if extention.record>checked="checked"</#if>>
	            </div>
	        </div>
	        <div class="layui-inline">
	        	<label class="layui-form-label">后处理：</label>
	            <div class="layui-input-inline">
	                <input type="checkbox" name="afterprocess" lay-skin="switch" lay-text="开启|关闭" <#if extention.afterprocess>checked="checked"</#if>>
	            </div>
	        </div>
        </div>
                
        <div class="layui-form-item">
            <label class="layui-form-label">自动接听来电：</label>
            <div class="layui-input-inline" style="width:300px;">
            	<input type="radio" name="autoanswer" value="none" title="禁用" <#if !(extention.autoanswer??) || extention.autoanswer == "none">checked="checked"</#if>>
                <input type="radio" name="autoanswer" value="all" title="全部来电" <#if extention.autoanswer?? && extention.autoanswer == "all">checked="checked"</#if>>
				<input type="radio" name="autoanswer" value="queue" title="队列" <<#if extention.autoanswer?? && extention.autoanswer == "queue">checked="checked"</#if>>
            </div>
        </div>
        
        <div class="layui-form-item">
            <label class="layui-form-label">启用WebRTC：</label>
            <div class="layui-input-inline">
                <input type="checkbox" name="enablewebrtc" lay-skin="switch" lay-text="开启|关闭" <#if extention.enablewebrtc>checked="checked"</#if>>
            </div>
        </div>
        <div class="layui-form-item">
	        <div class="layui-inline">
	            <label class="layui-form-label" >号码：</label>
	            <div class="layui-input-inline" style="width:670px;">
	                <select name = "outnum" id="outnum">
	                    <#if numberPoolList?? && numberPoolList?size gt 0>
	                    <option value="" >请选择外显号码</option>
	                    <#list numberPoolList as number>
	                    <option value="${number.number!''}">${number.number!''}</option>
	                    </#list>
	                    </#if>
	                </select>
	            </div>
	
	        </div>
        </div>
        <div class="layui-form-button">
            <div class="layui-button-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript" src="multiSelect.js"></script>
<script>
	layui.use('form', function(){
	  var form = layui.form;
	  form.render();
	});
</script>